home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_a / exscan.txt < prev    next >
Text File  |  1995-04-22  |  9KB  |  1 lines

  1. QPp65t1b64l0r80     I am attempting to setup a scanner program for my Epson EX-1000 printer.I would appreciate any help I can get to accomplish this task.I am working with the following equipment.Atari 800XL w/256 up-grade installed.Atari 1050 Disk Drives, 1 w/USD & 2 Happy.Zenith Data Systems Color Monitor.Atari 850 InterfaceAvatex 1200 Modem connected to R1.Epson EX-1000 connected to 850.              Color Option Kit.              Scanner Option Kit.     This Scanner Kit included "INSET" a Graphics and text integrator program.  However, INSET is for an IBM or compatible computer.  I would liketo run this scanner on the Atari system.  I have been told that an Atarican not handle this scanner, by an IBM user.  I would like to prove otherwise,if possible.The Example Software Control is as follows.                  start       Check the scanner I.D.(Esc I)          set data format (Esc D)        set data bit order (Esc E)       select the half-tone process (Esc B)       set intensity (Esc L)       set gain curve (Esc Z)       set resolution (Esc R)       set read area (Esc A)       confirm setting (Esc S)       start scan operation (Esc G)                    l     l>>>>>>>>>>>>>>l     l              l     l    receive image data block     l            error >>>>>>>> yes >>>>l     l          area end ? >>>>> yes >>>>l     l   abort scan operation ?>>yes >>>>l     l              l             l      l     l<<<<<<<<<<send ACK      send CAN   l                             l      l              l<<<<<<<<<<<<<<<<<<<<<l            Exit ACK = dec. 6,  NAK = dec. 21,  STK = dec. 2,  CAN = dec. 24Data format for i =i = 01H (Data format) = 1 bit/pixel (8 pixel/byte: default) MSB  n  n+1 n+2 n+3 n+4 n+5 n+6 n+7 LSB      D   D   D   D   D   D   D   Di = 04H (Data format) = 4 bit/pixel (2 pixel/byte)             n              n+1      D3  D2  D1  D0  D3  D2  D1  D0i = 06H (Data format) = 6 bit/pixel (1 pixel/byte)      D5  D4  D3  D2  D1  D0  0   0i = 16H (Data format) = 6 + 1 bit/pixel (1 pixel/byte)      D5  D4  D3  D2  D1  D0  0   DXThe format of the data block is:Sequence   #(Bytes) Description  1st         1     Header, STX(02H)  2nd         1     Status (See below)  3rd         2     #of data byte n(binary) (Lower byte is first)  4th         n     n bytes of dataThe format of the status byte is:Function                 when 0    when 1bit 7: Fatal error flag Normal    Errorbit 6: Reserved           -          -bit 5: Area end flag    Continue  End flagbit 4: Reserved           -          -bit 3: Reserved           -          -bit 2: Reserved           -          -bit 1: Reserved           -          -bit 0: Reserved           -          -    (bit 7 = MSB, bit 0 = LSB)Scanner Color Codes are:0 = Black          8 = Dark Gray1 = Blue           9 = Light Blue2 = Green          A = Light Green3 = Cyan           B = Light Cyan4 = Red            C = Light Red5 = Magenta        D = Light Magenta6 = Brown          E = Yellow7 = Light Gray     F = WhitePrinter Color Codes are:  (Esc r n)(n)        Color          Combination 0         Black          Black 1         Red            Red 2         Blue           Blue 3         Violet         Blue + Red 4         Yellow         Yellow 5         Orange         Yellow + Red 6         Green          Yellow + Blue     I have an Action Cartridge, a Basic XE & Basic XL Cartridges and theMac 65 Cartridge plus the Tool Kit for each.  I am used to programing inBasic, but assume it would be better to use the Action language or Mac 65, fora program of this nature.     The communication between the scanner and the host computer isperformed by exchanging control codes and data under specified formats.  Forboth the scanner and the computer, two codes, ACK and NAK, are used to confirmcorrect interpretation of commands and data.  Therefore, when programmingsoftware, the host computer should wait for the ACK or NAK codes from thescanner before attempting further control.  Also, the host computershould send ACK or NAK codes to the scanner whenever required.     If the host computer receives a NAK code for its command or parameter,it is probable that the format or the contents of the command is incorrect.     When a control code requires data to be sent back from the scanner, onlythe control code should be sent first.  The scanner sends back the requireddata in a specified format.  After the data is received by the host, the hostshould send an ACK code to the scanner indicating a request of the next data.If more data is to come, this process continues until the data transfer iseither completed or terminated.     Except for the last data block, the response of ACK from the host isnecessary before the next data block is sent.  If CAN is received, ACK is sentto the host instead of the data block, and this handshaking is terminated.     The data block containing the status byte with the error flag setindicates that the scanner will not send another data block.     The data block containing the status byte with an area end flag setis only used during scanner operation.  If this data block is received from thescanner, the host recognizes it as the last one.ESC I, the scanner sends back a data block that includes the identificationand some properties of the scanner.Data      Description                                      Data Var.STX       Header byte**        Status byted1, d2    Amount of data (2 bytes)                                13i1, i2    Identification of control code(2 bytes)     i1=41H & i2=32H"R",r1,r2 Readable resolution(pixel/inch)               72"R",r3,r4 Readable resolution(pixel/inch)              144"R",r5,r6 Readable resolution(pixel/inch)LQ-2500 only  N/A"A",x1,x2 Maximum horizontal area in dots at max. resolution  1584    y1,y2 Maximum vertical area in dots at maximum resolution   1152ESC S, this command requests the scanner to send a data block listing the current scanner settings, as shown below.  These settings indicatData        DescriptionSTX         Header**          Status byte26          Number of data(2 bytes)"C",0       Monochrome setting(fixed value)"R",m, n    Indicates horizontal m & vertical n resolution(See ESC R)"A",k,l,m,n Indicates read area(See ESC A)"D",i       Indicates data format(See ESC D)"B",i Indicates whether the 1 bit data is processed or not(See ESC B)"E",i       Indicates image data bit order(See ESC E)"L",i       Indicates intensity(See ESC L)"Z",i       Indicates gain curve(See ESC Z)NOTE:  The value of i is substituted for 1 byte binary.  The variables k,l,m,n are substituted individually for 2 byte binary, with the lowESC R, This command sets the horizontal and vertical reading resolution of the scanner.  The value of m determines the horizontal resolutioNOTE:  When the scanner accepts this control code, the read area is reset to its default values.     m     n    144   144    144   72    72    144    72    72ESC A, This command sets the readable area of the scanner in units of pixelsat the current resolution.  The variables are:  k = Horizontal offset data(2 bytes)  l = Vertical offset data(2 bytes)  m = Horizontal read area data(2 bytes)  n = Vertical read area data(2 bytes)ESC B, This command sets or cancels the half-tone process of 1 bit/pixelscanned data.  The values for i are:    0 : Sets half-tone process (default)    1 : Cancels half=tone process.This setting is available only when ESC D 01H or 16H is specified.  Thehalf-tone process automatically compares the data of the scanned pixelwith those of the surrounding pixels already scanned, and determines the 1bit value for the pixel.  This decreases the intensity error betweenthe source image and scanned data.ESC E, This command sets the image data bit order.  The value of the variablei is 0 or 1.  This setting is available only when ESC D 01H (data format1 bit/pixel) is specified.ESC L, This command sets the output intensity level.  Seven values fori are available: 00H, 01H, 02H, 03H, FFH, FEH, and FDH.lighter                        darker  03H  02H  01H  00H  FFH  FEH  FDH     The following are specific questions that I have regarding thescanners operation and control.    1.  Can the Atari Computer preform a formal hand